<%--
  Created by IntelliJ IDEA.
  User: 14122
  Date: 2022/8/18
  Time: 20:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="/${pageContext.request.contextPath}js/pintuer.js"></script>
</head>
<body>
<form method="post" action="">
    <div class="panel admin-panel">

        <table class="table table-hover text-center">
            <tr>
                <th width="120">ID</th>
                <th>用户名</th>
                <th>姓名</th>
                <th>密码</th>
                <th>性别</th>
                <th>电话</th>
                <th>地址</th>
                <th>邮箱</th>
                <th>状态</th>
                <th>操作</th>
            </tr>

            <c:forEach items="${employees}" var="employee">
                <tr>
                    <td><input type="checkbox" name="id[]" value="1" />${employee.empId}</td>
                    <td>${employee.userName}</td>
                    <td>${employee.name}</td>
                    <td>${employee.password}</td>
                    <td>${employee.gender}</td>
                    <td>${employee.phone}</td>
                    <td>${employee.address}</td>
                    <td>${employee.email}</td>
                    <td>${employee.deleted}</td>
                    <td><a type="button" class="button border-main" href="${pageContext.request.contextPath}/employee/updateEmployeePage?emp_id=${employee.empId}"><span class="icon-edit"></span>修改</a>
                        <a class="button border-red" href="${pageContext.request.contextPath}/employee/deleteEmployee?emp_id=${employee.empId}" onclick="return del(17)"><span class="icon-trash-o"></span> 删除</a></td>
                </tr>
            </c:forEach>




            <tr>
                <td colspan="8"><div class="pagelist">  <a href="${pageContext.request.contextPath}/employee/employeePage?pageNume=1">返回</a> </div></td>
    </div></td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    function del(id){
        if(confirm("您确定要删除吗?")){

        }
    }

    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

    function DelSelect(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var t=confirm("您确认要删除选中的内容吗？");
            if (t==false) return false;
        }
        else{
            alert("请选择您要删除的内容!");
            return false;
        }
    }

</script>
</body></html>

